/**
 * 表结构初始化
 */

const { Sequelize, Model } = require('sequelize')
const { sequelize } = require('@core/db.js')

class User extends Model {

}

User.init({
  id: {
    type: Sequelize.INTEGER,
    primaryKey: true,
    autoIncrement: true
  },
  email: Sequelize.STRING,
  password: Sequelize.STRING,
  openId: {
    type: Sequelize.STRING,
    unique: true
  },
  nickname: Sequelize.STRING
}, {
  sequelize,
  tableName: 'test_user'
})

module.exports = {
  User
}